#include "common.h"

int ans = 0;
int tem = 0;
void dfs(vector<int>& nums, int index)
{
	for (int i = index; i < nums.size(); i++)
	{
		tem ^= nums[i];
		ans += tem;
		dfs(nums, i + 1);
		tem ^= nums[i];
	}
}
int subsetXORSum(vector<int>& nums)
{
	dfs(nums, 0);
	return ans;
}